<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>

  <body>
    <button>得到所有的省份数据</button>
    <script>
      async function getProvinces() {
        const url = 'http://study.yuanjin.tech/api/local';
        const resp = await fetch(url);
        const result = await resp.json();
        console.log(result);
      }

      document.querySelector('button').onclick = function () {
        getProvinces();
      };
    </script>
  </body>
</html>
